 package server.console.groups.datamanage;

 import com.alee.laf.rootpane.WebFrame;
 import java.util.List;
 import java.util.Map;
 import java.util.Vector;
 import javax.swing.table.DefaultTableModel;
 import server.MapleItemInformationProvider;
 import server.life.MapleMonsterInformationProvider;
 import server.maps.MapleMapFactory;
 import server.reward.RewardDropEntry;

 class FishingPane
   extends TabbedPane
 {
/*  16 */   private final Map<Integer, Map<Integer, List<RewardDropEntry>>> fishDrops = MapleMonsterInformationProvider.getInstance().getFishDrop();
   private DefaultTableModel defaultTableModel_ID;

   FishingPane(WebFrame owner) {
/*  20 */     super(owner);
   }


   void init() {
/*  25 */     this.idTableName.add("地图ID");
/*  26 */     this.idTableName.add("地图名称");

/*  28 */     this.dataTableName.add("鱼饵");
/*  29 */     this.dataTableName.add("道具ID");
/*  30 */     this.dataTableName.add("道具名称");
/*  31 */     this.dataTableName.add("数量");
/*  32 */     this.dataTableName.add("爆率(百分比)");
/*  33 */     this.dataTableName.add("消息类型");
/*  34 */     this.dataTableName.add("限时");
/*  35 */     this.dataTableName.add("潜能状态");


/*  38 */     Vector<Vector<String>> datas = new Vector<>();
/*  39 */     for (Integer integer : this.fishDrops.keySet()) {
/*  40 */       Vector<String> data = new Vector<>();
/*  41 */       data.add(String.valueOf(integer));
/*  42 */       data.add(getIDName(String.valueOf(integer)));
/*  43 */       datas.add(data);
     }
/*  45 */     this.defaultTableModel_ID = new DefaultTableModel(datas, this.idTableName);
   }


   String getTitle() {
/*  50 */     return "钓鱼";
   }


   protected DefaultTableModel getIDTableModel() {
/*  55 */     return this.defaultTableModel_ID;
   }


   protected DefaultTableModel getDataTableModel() {
/*  60 */     Vector<Vector<String>> datas = new Vector<>();
/*  61 */     if (this.idTable.getSelectedRow() > -1) {
/*  62 */       String id = (String)this.idTable.getValueAt(this.idTable.getSelectedRow(), 0);
/*  63 */       if (this.fishDrops.containsKey(Integer.valueOf(id))) {
/*  64 */         for (Map.Entry<Integer, List<RewardDropEntry>> listEntry : (Iterable<Map.Entry<Integer, List<RewardDropEntry>>>)((Map)this.fishDrops.get(Integer.valueOf(id))).entrySet()) {
/*  65 */           for (RewardDropEntry rewardDropEntry : listEntry.getValue()) {
/*  66 */             Vector<String> data = new Vector<>();
/*  67 */             data.add(((Integer)listEntry.getKey()).toString());
/*  68 */             data.add(String.valueOf(rewardDropEntry.itemId));
/*  69 */             data.add(getDataName(String.valueOf(rewardDropEntry.itemId)));
/*  70 */             data.add(String.valueOf(rewardDropEntry.quantity));
/*  71 */             data.add(String.valueOf(rewardDropEntry.chance / 10.0D) + "%");
/*  72 */             data.add(String.valueOf(rewardDropEntry.msgType));
/*  73 */             data.add(String.valueOf(rewardDropEntry.period));
/*  74 */             data.add(String.valueOf(rewardDropEntry.state));
/*  75 */             datas.add(data);
           }
         }
       }
     }

/*  81 */     return new DefaultTableModel(datas, this.dataTableName);
   }


   protected String getIDName(String id) {
/*  86 */     return MapleMapFactory.getMapName(Integer.valueOf(id).intValue());
   }


   protected String getDataName(String id) {
/*  91 */     return id.equals("0") ? "金币或经验" : MapleItemInformationProvider.getInstance().getName(Integer.valueOf(id).intValue());
   }


   protected Vector<String> getDefaultDataVector() {
/*  96 */     Vector<String> vector = new Vector<>();
/*  97 */     vector.add("2300000");
/*  98 */     vector.add("0");
/*  99 */     vector.add("");
/* 100 */     vector.add("1");
/* 101 */     vector.add("0%");
/* 102 */     vector.add("0");
/* 103 */     vector.add("0");
/* 104 */     vector.add("0");
/* 105 */     return vector;
   }


   protected boolean hasNameDataTable(int i) {
/* 110 */     return (i == 1);
   }
 }


/* Location:              C:\PGX\Server.jar!\server\console\groups\datamanage\FishingPane.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */